page-alloc/x86: don't restrict DMA heap to node 0
authorJan Beulich <jbeulich@suse.com>
Thu, 11 Aug 2016 11:35:50 +0000 (13:35 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 11 Aug 2016 11:35:50 +0000 (13:35 +0200)
commitd0d6597d3d682f324b6a79e3278e6f5bb6bad153
tree8087e1bd820cffe06cc1a3b157f0340da0be7858
parent1d6569a74bd6bfc87fa51ebaa85aee5723070c10
page-alloc/x86: don't restrict DMA heap to node 0

When node zero has no memory, the DMA bit width will end up getting set
to 9, which is obviously not helpful to hold back a reasonable amount
of low enough memory for Dom0 to use for DMA purposes. Find the lowest
node with memory below 4Gb instead.

Introduce arch_get_dma_bitsize() to keep this arch-specific logic out
of common code.

Also adjust the original calculation: I think the subtraction of 1
should have been part of the flsl() argument rather than getting
applied to its result. And while previously the division by 4 was valid
to be done on the flsl() result, this now also needs to be converted,
as is should only be applied to the spanned pages value.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/numa.c
xen/common/page_alloc.c
xen/include/asm-arm/numa.h
xen/include/asm-x86/numa.h